<?php
	

	// Nese leximi i faqes behet nga ndonje burim ekstern duke mos e definuar identifikatorin e librit
	if (!isset($_GET['id'])) {
		header("Location: index.php?splash=wrong");
		exit;
	}
	
	// Integrimi i skedave sistemore
    include('../include/functions.inc.php');
	include('../include/template.class.php');
	
	
	// PROJECT
	$PROJECT = setProject();
	
	
	// Ndyshoret primare
	define('TPL','../include/styles/'.$PROJECT['style'].'/print/book.html');
	define('FILENAME',basename($_SERVER["PHP_SELF"]));
	define('ID',$_GET['id']);
	
	
	// DB CONNECT
	dbOpen("library");
	
	
	// TMP CLASS
	$tmp = new Template(TPL,$PROJECT['lang']);

	
	
	// TOPBOOKS
	$query = mysql_query("SELECT author_id,volume,title
						  FROM library 
						  WHERE id='".ID."' ");
        
	$BOOK = mysql_fetch_assoc($query);
	$BOOK['author'] = implode(mysql_fetch_assoc(mysql_query("SELECT name FROM users WHERE id=".$BOOK['author_id']."")));
	$BOOK['content'] = implode(mysql_fetch_assoc(mysql_query("SELECT content FROM contents WHERE book_id=".ID."")));
	$BOOK['date'] = setDate($_SERVER['REQUEST_TIME']);
	
	// BOOKS
	$tmp->setContent($BOOK);
	
	// LABELS
	$tmp->setLabels();

	// DISPLAY ALL						  
	echo $tmp->vorlage;	
?>